home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / asmgen2.arc / ASMGEN2.DOC < prev    next >
Text File  |  1988-10-23  |  25KB  |  593 lines

  1.  
  2.  
  3. ************************************************************************
  4. *                                       *
  5. *   ASMGEN.COM - by J. Gersbach   and  J. Damke    (Ver. 2.01)           *
  6. *                                       *
  7. *   A program to generate cross-referenced assembly language code      *
  8. *   from any executable file.                           *
  9. *                                       *
  10. *                                       *
  11. *                                       *
  12. *   Uploaded to PCanada by Mark Magner     November 23, 1983           *
  13. *                                       *
  14. ************************************************************************
  15.  
  16.  
  17.  
  18. *  PREFACE  *
  19.  
  20.  
  21. This program will generate 8086/87/88 assembly code text
  22. that is compatible with the IBM Personal Computer Macro
  23. Assembler from any executable diskette file up to 65,535
  24. bytes.    The output can be routed to the console or a disk-
  25. ette file.  A reference list may be generated separately or
  26. embedded at the appropiate instruction counter address in
  27. the assembly code.
  28.  
  29. Some manual touch up will be required before reassembly, but
  30. nearly all the typing is done for you by ASMGEN and anything
  31. questionable is marked with "??".
  32.  
  33. A file of sequential instructions may be resident on the
  34. same diskette to indicat to ASMGEN which addresses contain
  35. code, byted, words, or strings.  This file may also include
  36. instructions to assume segment register values or toggle the
  37. output of assembley code text, generation of the reference
  38. table, 8087 mnemonics, of the inclusion of embedded reference
  39. information in the assembly file.
  40.  
  41. DEBUG may be used to browse through the executable file to
  42. determine the starting locations of code and data to develop
  43. the sequential instruction file.  It is important to accu-
  44. rately specify these locations for an accurate reference
  45. tabel and minimum touching up of the ASM output text.
  46.  
  47. The number of references within the file determines the amount
  48. of memory required since a reference tabel is built in
  49. memory during the first pass.  Disassembly is done from disk
  50. and only one file sector is in memory at any given time.
  51. Therefore memory size does not limit the size of the file
  52. to be disassembled.  48K bytes of memory will be enough for
  53. most programs but a few will need 64K or 128K.    One diskette
  54. drive is sufficient but two is more convenient.
  55.  
  56.  
  57. *  STARTING ASMGEN  *
  58.  
  59. There are two ways to work with ASMGEN:  either by using the
  60. command menu or by calling ASMGEN with parameters.
  61. Following are the descriptions of both options.
  62.  
  63. *  USING THE ASMGEN MENU  *
  64.  
  65. The program is invoked by typing:  ASMGEN
  66.  
  67. You are then prompted for a file specification.  Respond with
  68. the name of the executable file from which you wish to
  69. generate the assembly code.  The executable file will normally
  70. have an extension of .EXE or .COM.  ASMGEN will check this
  71. file spec for validity and then respond with a prompt that
  72. includes a summary of the command letters indicating that
  73. you may give it a command.  The executable file contents
  74. are not checked for valid code and ASMGEN will try to dis-
  75. assemble text or compressed BASIC files and produce unintell-
  76. igible assembly code.
  77.  
  78. The commands are:
  79.  
  80. X filespec    This file spec replaces any previous executable
  81.         file spec.  The usual file extension is .COM
  82.         or .EXE
  83.  
  84.         EXAMPLE:  X DATE.COM
  85.  
  86.  
  87. A <filespec>    The executable file is disassembled and the assem-
  88.         bly code is routed to the specified file.  The
  89.         usual file extension is .ASM.  If the filespec is
  90.         omitted, the output will default to the console.
  91.  
  92.         EXAMPLE:  A DATE.ASM
  93.  
  94. R <filespec>    The reference table is sent to the file specified.
  95.         The usual file extension is .TBL.  If the filespec
  96.         is omitted, the output will default to the console.
  97.  
  98.         EXAMPLE:  R DATE.TBL
  99.  
  100. Q        The program is terminated and control returned to
  101.         DOS.
  102.  
  103.  
  104. Each time a command has been executed, ASMGEN waits with a one line
  105. prompt for the next command.
  106.  
  107. X <filespec>, A <CON>, R <CON> or Q ?
  108.  
  109. The default filespec for each command is shown in brackets.  Enter
  110. the next command of your choice as described above.
  111.  
  112.  
  113. *  USING ASMGEN WITH PARAMETER CALLS  *
  114.  
  115. Up to three file specifications may be included when ASMGEN is
  116. first called from DOS.    The executable file's name is given first,
  117. followed by specifications for the assembly and reference table
  118. files.
  119.  
  120. EXAMPLE:  ASMGEN DATE.COM, DATE.ASM, DATE.TBL
  121.  
  122. If a semicolon follows the last filespec, ASMGEN will exit to DOS
  123. when the command has been executed.  If no semicolon is entered,
  124. ASMGEN will display the menu options described above and wait for
  125. further input after executing the command.
  126.  
  127. EXAMPLE:  ASMGEN DATE.COM, DATE.ASM;
  128.  
  129. If the filespec for the .ASM file and/or .TBL file is omitted,
  130. ASMGEN will generate first the .ASM file, then a .TBL file using
  131. the filename of the first filespec.
  132.  
  133. EXAMPLE:  ASMGEN DATE.COM,,; creates DATE.ASM and DATE.TBL and exits
  134.                  to DOS.
  135.  
  136. If only the reference table is desired, the dummy name NUL should be
  137. entered in place of an .ASM filespec
  138.  
  139. EXAMPLE:  ASMGEN DATE.COM, NUL, DATE.TBL
  140.  
  141. If only one filespec is given when the program is called, the reference
  142. table is built in memory and then the menu options are displayed for
  143. further commands.
  144.  
  145. EXAMPLE:  ASMGEN DATE.COM
  146.  
  147.  
  148. *  PROGRAM EXECUTION  *
  149.  
  150. The disassembly is done in two passes through the scource file.  On pass
  151. #1, the reference table is built in memory and the actual output is gen-
  152. erated during pass #2.    Once the reference table is established, it remains
  153. in memory until an X or Q command is issued, and subsequent A and R com-
  154. mand executions skip pass #1.  This saves a lot of time when the executable
  155. file is large.
  156.  
  157. Three contiguous data areas are built dynamically in memory during pass #1.
  158. First is the compressed sequential instruction list.  Second is a list of
  159. pointers for .EXE files that point to the locations of all relocatable
  160. variables in the program, also arranged in numerical order.  These are
  161. established before reading any code.  Third, the reference table is then
  162. built in a higher area of memory as pass #1 progresses.
  163.  
  164. If all available memory in the program segment is filled before the first
  165. two data areas are completed, ASMGEN will abort to the command prompt.
  166. After the reference table is started, a shortage of memory will produce
  167. the message "Reference Table Incomplete Due to Insufficient Memory" and
  168. continue.
  169.  
  170. Ctrl-Break may be used at any time to interrupt a command in progress.
  171.  
  172.  
  173. *  READING THE ASSEMBLY CODE FILE (.ASM)  *
  174.  
  175. This file begins with a title taken from the executable file's name and
  176. date followed by the current date (in brackets).
  177.  
  178. If not inhibited by the  M  switch in a SEQ file (explained later), the macro
  179. library will appear next in the file.
  180.  
  181. Next will be a .RADIX 16 pseudo-op which tells the macro assembler that all
  182. numbers are in hexadecimal form.
  183.  
  184. Then comes a header that indicates a starting value for the code segment,
  185. stack segment, instruction pointer and the stack pointer.  The stack pointer
  186. is usually set to FFFF for .COM files but may be somewhat less depending on
  187. available memory.  These values are passed by the linker for .EXE files.
  188.  
  189. The first ASSUME statement might come next.  There is one generated for each
  190. segment that begins with code.    All segment registers are designated according
  191. to the current set of ASSUMEs.    They will sometimes be incorrect, so all
  192. ASSUME statements should be checked prior to re-assembly.
  193.  
  194. The disassembled output follows, terminated by an END statement and the
  195. execution address.  An ORG psuedo-op is included if required.
  196.  
  197. The text is compatible with the IBM Macro Assembler and the format is the same
  198. except for RETurns.  To avoid the need for PROCedure titles, special mnemonics
  199. are provided for all RET instructions.    These are defined in the macro library
  200. at the beginning of the file.  Only macros that are needed for the current file
  201. are produced.  The optional embedded commands that make up the reference table
  202. enhance the readability of the file.  For very large files, this is sometimes
  203. undesirable and a separate reference table is best.
  204.  
  205. When invalid instructions are encountered in code areas, they are reproduced
  206. as byte values followed by "??".  If a near jump is defined previously in the
  207. code, and it is within range of a short jump, a NOP instruction is inserted
  208. after the jump.  The executable file created with this .ASM file and the
  209. Macro Assembler and Linker will then be the same length as the original file.
  210. This makes it less important to differentiate between labels and numeric
  211. constants since the label values and their offsets within the file will be
  212. the same.  The fundamental problem of disassembly is in knowing if the
  213. original assembly code defined a number as a label which changes as a function
  214. of it's position or as a number that always remains the same.  If you make
  215. changes in the assembly code however, you must properly specify all values.
  216. You might as well remove all NOPs at the same time.
  217.  
  218. Labels are five characters long and begin with "L".  Segment labels begin with
  219. "S".  The remaining characters are the current instruction counter in hex
  220. form, thus making each label unique and showing it's location in the original
  221. file.  The instruction counter is continuous throughout the assembly code
  222. without resetting at segment boundaries.  The segment labels are then in byte
  223. as opposed to paragraph form.  In those cases where a label value is modified
  224. by an ASSUME statement, the original value is included as a comment in the
  225. referencing instruction so that it may be easily changed back if it was not
  226. intended as a location.
  227.  
  228. The word "Relocatable" is printed at the end of any line that contains an
  229. ablolute paragraph value.  These are values that DOS modifies after loading but
  230. befor executing a program.  They are used for loading segment registers that
  231. are sensitive to the program location in menory.  Relocatable values are not
  232. modified by ASSUMEs.  ASMGEN converts these numbers from paragraph to byte
  233. values by multiplying them by sixteen so that they will fit within the 16-bit
  234. instruction counter field.  When the paragraph value is negative or exceeds
  235. 0FFFH, it is left unchanged and a warning (??) is issued on that line.    When
  236. a program larger than 64K bytes is being disassembled, it should be divided
  237. into smaller files.
  238.  
  239. All words are produced as labels, except when the "L" switch has been enacted
  240. in the .SEQ file (explained later).  The label name indicates it's numeric
  241. value and, if it does not occur on an instruction boundary, the name indicates
  242. it's position relative to the current instruction pointer is given by an EQU
  243. statement.  Therefore the Macro Assember will assume that it is a location,
  244. but it is easily changed to a constant since the value is given in the label
  245. name.  The word OFFSET precedes a label whenever it is questionable whether
  246. it is a label or an immediate value.  You must decide which of the labels
  247. should be constants and which of the constants should be labels, and change
  248. them accordingly.  When changing labels to numbers, be sure to append an
  249. "H" if the number ends with a "D" or a "B" since the Macro Assembler will
  250. otherwise assume that it is decimal or binary.
  251.  
  252. Bytes are always treated as constants.    An optional switch may be included in
  253. the .SEQ file (explained later) which enables numbers instead of labels if all
  254. references to the value are data segment and immediate operation types.
  255.  
  256. An effective procedure to follow in attempting to understand the assembly code
  257. file is to look first for the message text area, the input commands, and the
  258. simpler subroutines.  Then add label names to addresses in the .SEQ file
  259. (explained later) that remind the you of their purpose.  Add comments to the
  260. labels.  If these names are well chosen, the larger routines eventually will
  261. become clear.  The embedded references are produced as labels so they will
  262. retain their meanings as they are changed.
  263.  
  264. It is also helpful to spend some time studying the structure of data areas.
  265. Vector tables, which are frequently used to control the program's flow, reveal
  266. the program's structure very quickly.  If some routines do not have labels at
  267. the beginning, it is usually because the code or tables that reference them
  268. (or the segment register assumptions) are not properly defined in the .SEQ
  269. file.
  270.  
  271.  
  272. *  READING THE REFERENCE TABLE (.TBL)  *
  273.  
  274. A referencee is defined as a number that is referenced somewhere in the
  275. program.  It may be a program loaction or a numeric constant.
  276.  
  277. A referencor is is defined as the address in the program from which a refer-
  278. ence is made to the referencee.
  279.  
  280. Each entry is composed of a referencEE    followed by a list of referencors.  If
  281. more than one line is needed, additional lines are indented to the first
  282. referencor position.  The referencEE is followed by an "S" if it includes
  283. references to the beginning of segment.  The referencor is followed by two
  284. letters, the first of which represents the segment register that is implied
  285. or prefixed in the referencing instruction.  The second letter indicates the
  286. type of operation on the referencEE.  When the reference entries are embedded
  287. in the assembly code, all values are preceded with the letter "L".
  288.  
  289. ----------------------------------------------------------------------------
  290. 1st letter    |  2nd letter
  291. SEG REGISTER    |  TYPE OF OPERATION
  292. ----------------------------------------------------------------------------
  293. C  code     |  J  jump       M  modify - INC, ADD, etc.
  294. S  stack    |  C  call       I  immediate - value or offset
  295. D  data     |  R  read       T  test or compare
  296. E  extra    |  W  write       ?  unknown or ESC instruction
  297.         |  P  port
  298. ----------------|-----------------------------------------------------------
  299.  
  300.  
  301.  
  302. *  WRITING/READING THE SEQUENTIAL INSTRUCTION FILE (.SEQ)  *
  303.  
  304. The sequential instruction file is a list of special instructions to ASMGEN
  305. which the user creates.  The file takes the form of a list of hexadecimal
  306. addresses and single-letter instructions or generation switches.  If used,
  307. the .SEQ file must be on the same diskette as the source file and have the
  308. same name as the source file with an extension of .SEQ.  Each instruction in
  309. the file must be in one of the following formats:
  310.  
  311. addr    command
  312. or
  313. addr    command     ;comment
  314. or
  315. addr    command     label    comment
  316. or
  317. addr    command     label    comment ;comment
  318.  
  319. "addr" represents the instruction pointer value.  All addr values must be in
  320. numerical sequence in the file.
  321.  
  322. "command" may be either a toggle switch or a generation instruction.
  323.  
  324. "label" is optional and replaces the label generated for this address with
  325. this non-blank string.
  326.  
  327. "comment" is optional and must be preceded by "label" unless the dummy label
  328. "." is used.  Everything following "label" is treated as an address comment
  329. and will be printed in the ASM file behind the generated instruction.  The
  330. address comment may be up to 255 characters in length and should not contain
  331. a semi-colon.
  332.  
  333. ";comment" is optional.  Anything following a semi-colon in the .SEQ file
  334. instructions is considered as a comment in the .SEQ file only and is not added
  335. to the generated .ASM file.
  336.  
  337. "label" and "comment" are not allowed when a generation switch is coded, but
  338. a ";comment" may be used to help clarify the .SEQ file.
  339.  
  340. The .SEQ file is read into memory before the first pass starts.  The addresses
  341. and commands will be compressed, but "label" and "comment" will be held in
  342. memory one to one.  An effect of this is that memory space required for dis-
  343. assembly increases with each "label" and "comment" added to the .SEQ file.
  344.  
  345.  
  346. *  DESCRIPTION OF GENERATION SWITCHES  *
  347.  
  348. THE VARIOUS TOGGLE SWITCHES ARE SET TO ON BY DEFAULT.  Switches may be toggled
  349. on and off at any point in the .SEQ file/disassembly.
  350.  
  351. All options switches except /M and /H can be either toggled or directly set by
  352. the user.  A suffix of "+" turns the switch ON, and a suffix of "-" turns the
  353. switch OFF.  Switches encountered in the file that have neither of these
  354. suffixes are toggled to the opposite of their state at the time; ON switches
  355. are turned OFF and OFF switches are turned ON.
  356.  
  357. /B - generate byte references
  358.  
  359. When ON, byte and word references are included in the reference table.    When
  360. OFF, only word references are generated.
  361.  
  362. /E - embedded references in ASM file
  363.  
  364. When ON, reference table entries are inserted in the text just before the
  365. referencee's definition statement.  When OFF, these entries are not included
  366. with the disassembled text.  The entire reference table can be printed with
  367. the "R" command.
  368.  
  369. /F - 8087 mnemonics
  370.  
  371. When ON, ESC instructions are produced.  When OFF, ESC instructions are assumed
  372. to be 8087 instructions and 8087 mnemonics are produced.
  373.  
  374. /H - append hex "H"
  375.  
  376. When this switch appears at any point in the .SEQ file, an "H" is appended to
  377. all hex numbers.  This does not, of course, apply to the labels which are
  378. hex values preceded by the letter "L".    The .RADIX 16 pseudo-op is omitted
  379. which allows the assembler's radix to default to decimal.  This switch defaults
  380. to NO H APPEND.  Note that it will be set only once.  It retains it's value
  381. until the next .SEQ file is read.
  382.  
  383. /L - generate label or number
  384.  
  385. When ON, all word references are treated as labels.  When OFF, a word reference
  386. is treated as a constant if all referencors are data immediate types.
  387.      
  388. /M - suppress macro library
  389.  
  390. When this switch appears at any point in the .SEQ file, no macro library is
  391. included in the text output.  The DEFAULT IS THAT THE MACRO LIBRARY WILL BE
  392. INCLUDED.  Note that this switch will be set only once.  It retains it's
  393. value until the next .SEQ file is read.
  394.  
  395. /O - control ASM output
  396.  
  397. When ON, ASMGEN will output the generated text.  When OFF, output will be
  398. suppressed.
  399.  
  400. /R - control TBL output
  401.  
  402. When ON, ASMGEN will output the generated reference data.  When OFF, the
  403. reference table is not printed.
  404.  
  405. /T - control trace output
  406.  
  407. When ON, up to 16 bytes of object code are included as comments in each line
  408. of the assembly code file.  When OFF, object code is not included.
  409.  
  410.  
  411. *  DESCRIPTION OF .SEQ FILE COMMANDS  *
  412.  
  413. A - assume
  414.  
  415. The following lines contain ASSUMptions for segment register values.  They
  416. become effective at the address specified by this instruction and may be
  417. modified anywhere in the disassembly.  The required format for assumptions is:
  418.  
  419. & 0400    DS
  420.  
  421. The ampersand indicates a continuation of the A instruction.
  422.  
  423. In this example, a data segment beginning at a instruction pointer value of
  424. 400 will be assumed until another  A  instruction changes it.  CS, ES, and
  425. SS are also supported.    The segment assumptions are used for effective address
  426. calculations only.  The code segment assumption does not affect the instruction
  427. pointer value.
  428.  
  429. B - bytes
  430.  
  431. The bytes encountered in the source file are assumed to have meaning as single
  432. byte values.
  433.  
  434. C - code
  435.  
  436. The bytes encountered in the source file are assumed to be valid 8088 machine
  437. language instructions.
  438.  
  439. D - generate data operand
  440.  
  441. The operand of the instructions is changed to immediate data.  Subsequent bytes
  442. are interpreted as "C" (code follows).
  443.  
  444. I - initial value for IP
  445.  
  446. The hexadecimal value on this line overrides the instruction pointer value at
  447. the beginning of the file - not to be confused with the address at which
  448. execution begins.  The default values are 0000 for EXE files and 0100H for COM
  449. and other files.  The execution address following the END statement is omitted
  450. if this option is invoked.
  451.  
  452. S - strings
  453.  
  454. The bytes encountered in the source file are assumed to form text.  Quoted text
  455. is produced for valid ASCII characters and byte values for others.
  456.  
  457. # - defined length strings
  458.  
  459. The first byte encountered in the source file contains the length of the
  460. character string which begins with the next encountered character.  This length
  461. value may be overridden by a subsequent SEQ file instruction.
  462.  
  463. $ - defined length strings
  464.  
  465. The first byte encountered in the source file contains the length of the
  466. character string which begins with the next encountered character plus the
  467. length byte itself.  This length value may be overridden by a subsequent SEQ
  468. file instruction.
  469.  
  470. W - words
  471.  
  472. Pairs of bytes encountered in the source file are assumed to have meaning
  473. as word values.
  474.  
  475. X - repeating data structure
  476.  
  477. A cyclic data structure is assumed to begin at the specified instruction
  478. pointer value.    The structure definition may follow and is prefixed by
  479. an ampersand (&) to indicate the continuation of this instruction.  If the
  480. definition does not follow, then the most recent definition is used.  If no
  481. structure is yet defined, then an error message is displayed.
  482.  
  483. The following elements may be used to define the structure:
  484.  
  485. & NNNN S  -  The next NNNN bytes are defined as string characters
  486. & NNNN B  -  The next NNNN bytes are defined as byte values
  487. & NNNN W  -  The next NNNN bytes are defined as word values
  488. & XXNN $  -  The next sequence of bytes is defined as NN fields.  Each field
  489.          consists of a length byte and a string of characters.  The length
  490.          of each field is contained in the first encountered byte.    The
  491.          high nibble (XX), if non-zero, is a bit mask of the length field
  492.          within the byte.  The length field is right-justified within the
  493.          byte after the byte value is sent to the output file.
  494.  
  495.  
  496.  
  497. *  EXAMPLES OF .SEQ COMMANDS  *
  498.  
  499. This example .SEQ file shows all the possible instructions in the appropriate
  500. format.
  501.  
  502. ;All switches are on at the beginning.
  503. 0    /T    ;no object code as comments in output
  504. 0    /M    ;no macro library in output
  505. 0    /H    ;append "H" to all numbers
  506. 00H    /A    ;assume the following segment values
  507. ;Note that the ampersand (&) indicates the extended ASSUME
  508. & 380    DS    ;the data segment starts at 380 hex
  509. & 380    ES    ;the extra segment starts at 380 hex
  510. 0200     I    ;initialize the instruction pointer to 200
  511. 0200    /F    ;introduce 8087 mnemonics (not ESC)
  512. 0200    /E    ;no embedded references
  513. 0200     C    ;code begins at 200
  514. 0203H     W    ;words are at 203
  515. 0207     C    ;more code starting here
  516. 220     X    ;complex data structure begins here
  517. & 3     W    ;words
  518. & 1     B    ;byte
  519. & 0E02     $    ;2 strings starting with the 2nd byte follow
  520.         ;bits 3,2,1 of the first byte contain the length of the
  521.         ;string including the length byte.
  522.         ;the high nibble (0E) is the mask.
  523.         ;see also # in summary below
  524. & 1     B    ;byte
  525.         ;the structure repeats until 351
  526. 351     B    ;bytes
  527. 358     C    ;more code
  528. 380     S    ;strings - list of messages
  529. 421     W    ;words
  530. 4FD    /B    ;no further byte references
  531. 502    /R    ;garbage here - turn off reference generation
  532. 502    /O    ;and output
  533. 600H    /O+    ;valid code - turn output back on
  534. 600    /R
  535. 600     C
  536. 1A60    /O-    ;output file about to fill diskette - turn output off but keep
  537.         ;scanning for references.
  538.         ;another run will be needed to get the remaining code.
  539. 1B00    /D    ;treat operand as immediate data
  540. 1DFD    /B+    ;continue with byte references
  541. 1F45     W    user_prt    ;user provided labels will translate
  542. 2256     S    $MSG        ;to upper case
  543.  
  544.  
  545. Comments may be included if preceded by a semicolon.
  546.  
  547. Alphabetic characters may be either upper or lower case.
  548.  
  549. An "H" may follow the hex address.
  550.  
  551.  
  552.  
  553. *  SAMPLE SESSION  *
  554.  
  555. The external command CHKDSK.COM will serve as an example for this sample
  556. session because it is short.  The .SEQ file is also short and easy to generate.
  557. Only these few instructions are needed.
  558.  
  559.  
  560. 0100  /T  ;include object code as comments in .ASM file
  561. 0100  /E  ;simpler output without references
  562. 04F7H  S  ;messages
  563. 04F7H /H  ;append "H" to numeric values
  564.  
  565. Using DEBUG, browse through CHKDSK.COM to see how this was arrived at.
  566. Usually, but not always, the best procedure is to assume code.    If the code
  567. appears unintelligible, display it in hex/ASCII.  If it is not text, assume
  568. bytes.    Label positions in the first disassembly may indicate that some
  569. locations should be words.  Next, generate the .ASM file by typing
  570.  
  571. ASMGEN CHKDSK.COM <enter>
  572. A          <enter>
  573.  
  574. The assembly code can be viewed on the screen.    Then type
  575.  
  576. A CHKDSK.ASM      <enter>
  577.  
  578. to save the assembly source code to a file.  Then,
  579.  
  580. R CHKDSK.TBL      <enter>
  581.  
  582. to save the cross-reference table to disk.
  583.  
  584. The Macro Assembler, Link.exe and Exe2bin could now be used to assemble
  585. CHKDSK.ASM, link it to .EXE and convert it to a .COM file.  No modification
  586. should be necessary in this case.
  587.  
  588. If working with code that is to be modified, the symbol types must be correctly
  589. specified as locations or as constants.  If they are constants, place them
  590. outside of any segment.  The label names may then be changed to make the code
  591. more readable.
  592.  
  593.